//
//  CommCell.m
//  OrderSeat
//
//  Created by 王威 on 14-1-7.
//  Copyright (c) 2014年 wangwei. All rights reserved.
//

#import "CommCell.h"
#import "UIImageView+WebCache.h"

@implementation CommCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setContent:(NSDictionary *)dic
{
    NSString *touxiang = [dic objectForKey:@"touxiang"];
    NSURL *url = [NSURL URLWithString:touxiang];
    
    if ([[NSNull null] isEqual:touxiang] || [touxiang isEqualToString:S_EMPTY]) {
        _logoView.image = [UIImage imageNamed:@"user_avatar.png"];
    }
    else {
        [_logoView setImageWithURL:url];
    }
    
    _nameLabel.text = [dic objectForKey:@"huiyuan"];
    _timeLabel.text = [dic objectForKey:@"add_time"];
    _commentLabel.text = [dic objectForKey:@"dianping"];
    [_commentLabel autoHeightForMutiLines];
    
    [self.backView drawBorder];
    [self.backView autoHeight];
    self.height = self.backView.bottom_5;
}

@end
